package org.uu.controller;

import org.apache.dubbo.config.annotation.DubboReference;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;
import org.uu.entity.UserDTO;
import org.uu.service.UserService;

@RestController
public class UserController {

    @DubboReference(loadbalance = "Random")
    private UserService userService;


    @GetMapping("/query/bynickname/{name}")
    public UserDTO queryUserByNickName(@PathVariable("name") String name) {
        UserDTO userDTO = userService.queryUserByNickName(name);
        return userDTO;
    }
}
